package controllers.util;

import controllers.BaseController;
import play.mvc.Result;
import util.Common;
import wechat.app.bean.shop.order.OrderInfo;
import wechat.app.bean.shop.order.OrderQueryByIdResult;
import wechat.app.bean.shop.order.OrderQueryByStatusAndTimeResult;
import wechat.app.bean.shop.shelf.*;
import wechat.app.bean.shop.shelf.module.Module;
import wechat.app.bean.shop.shelf.module.moduleFive.ModuleFive;
import wechat.app.bean.shop.shelf.module.moduleFour.ModuleFour;
import wechat.app.bean.shop.shelf.module.moduleOne.Filter;
import wechat.app.bean.shop.shelf.module.moduleOne.GroupInfo;
import wechat.app.bean.shop.shelf.module.moduleOne.ModuleOne;
import wechat.app.bean.shop.shelf.module.moduleThree.ModuleThree;
import wechat.app.bean.shop.shelf.module.moduleTwo.Group;
import wechat.app.bean.shop.shelf.module.moduleTwo.GroupInfos;
import wechat.app.bean.shop.shelf.module.moduleTwo.ModuleTwo;
import wechat.app.entityShopManage.OrderManage;
import wechat.app.entityShopManage.ShelfManage;
import wechat.app.getInterfaceCallCredentials.AccessToken;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;

/**
 * Created by Administrator on 2015/6/19.
 */
public class TestController extends BaseController {

    public static Result test() throws IOException {
        String appid = Common.getStringConfig("wechat.appid");
        String appSecret = Common.getStringConfig("wechat.appsecret");
        String token = AccessToken.getAccessToken(appid, appSecret);

//        String product_id = "p0vuzjoVFesfh10pxG8jvZrYAq-o";
//
//        String express_id = "408021047";
//
        String group_id = "407904363";
        String group_id2 = "407915318";

        String img = "http://mmbiz.qpic.cn/mmbiz/Hw5SEaHYvPia60h3t4icV2AVh25qvvKHhq9szAvNlicviag7uHhia9fm2CuK04gnAbVAmXxzyFibGTB7kZJzqASibUlAg/0";

        Date start = new Date((long) 1470818747 * 1000);
        Date end = new Date((long) 1470818748 * 1000);
//        System.out.println(start.getTime() / 1000);
//        OrderQueryByStatusAndTimeResult result = OrderManage.queryByStatusAndTime(token, null, start, end);
//        wechat.app.bean.Result result = OrderManage.setDelivery(token, "10282839253986723755", "002shentong", "111111", "1", "0");
        wechat.app.bean.Result result = OrderManage.close(token,"10282839253986723755");
        if (result.isSuccess()) {
            System.out.println(result.data);
        } else {
            System.out.println(result.errmsg_zn);
        }
        return ajaxSuccess("ok");
    }
}
